package com.abc.scholarship.domain.entity;

import com.abc.scholarship.domain.dto.StudentImportDto;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

/**
 * <p>
 * 专业表
 * </p>
 *
 * @author LiJunXi
 * @since 2024-07-02
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("tb_major")
@NoArgsConstructor
@AllArgsConstructor
public class Major implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 专业ID
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 专业名称
     */
    @TableField("major_name")
    private String majorName;

    /**
     * 创建时间
     */
    @TableField("create_time")
    private LocalDateTime createTime;

    /**
     * 修改时间
     */
    @TableField("update_time")
    private LocalDateTime updateTime;

    /**
     * 状态（1：正常，2：禁用）
     */
    @TableField("status")
    private Integer status;


    public Major(String majorName) {
        this.majorName = majorName;
    }

    public static Major buildFromExcel(StudentImportDto stuInfo) {
        return new Major(stuInfo.getMajor());
    }
}
